from io import StringIO
import pandas as pd

data = '''
A          B   C
 a 2021-01-01   1
 a 2021-01-02   2
 a 2021-01-03   3
 a 2021-01-04   5
 a 2021-01-05   6
 a 2021-01-06  10
 a 2021-01-07  12
 a 2021-01-08  14
 a 2021-01-09  12
 a 2021-01-10  30
 b 2022-01-01   1
 b 2022-01-02   2
 b 2022-01-03   3
 b 2022-01-04   4
 b 2022-01-05   5
 b 2022-01-06   6
 b 2022-01-07   7
 b 2022-01-08   8
'''
df = pd.read_csv(StringIO(data), delim_whitespace=True)
df = df.astype({"B": "datetime64[ns]"})
print(df)

# 移动 C 列 到 列索引为 0 的位置

name_c = df.pop("C")
df.insert(0, "C", name_c)
print(df)
